

package com.maoshi.shop.bean.model;

import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotation.*;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Data
@TableName("tz_area")
public class Area implements Serializable {
    private static final long serialVersionUID = -6013320537436191451L;

    @TableId
    @ApiModelProperty(value = "地区id",required=true)
    private Long areaId;

    @ApiModelProperty(value = "地区名称",required=true)
    @Size(min = 1, max = 20, message = "地区名称长度不能超过20")
    @NotBlank(message = "地区名称不能为空")
    private String areaName;

    @ApiModelProperty(value = "地区上级id",required=true)
    @NotNull(message = "地区上级id不能为空")
    private Long parentId;

    @ApiModelProperty(value = "地区层级",required=true)
    @NotNull(message = "地区层级不能为空")
    private Integer level;

    @TableField(exist=false)
    private List<Area> areas;

    @TableField(exist=false)
    private Integer maxGrade;
}
